package com.frxuexi.park2303.fragment

import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.blankj.utilcode.util.SPUtils
import com.frxuexi.base.http.Const
import com.frxuexi.base.mvi.BaseViewFragment
import com.frxuexi.base.utils.ArouterManager
import com.frxuexi.park2303.R
import com.frxuexi.park2303.databinding.FragmentMyBinding
import dagger.hilt.android.AndroidEntryPoint

@AndroidEntryPoint
class MyFragment : BaseViewFragment<FragmentMyBinding>() {
    override fun getBind(): FragmentMyBinding {
        return FragmentMyBinding.inflate(layoutInflater)
    }

    override fun initView() {
        binding.mychange.setOnClickListener {
            SPUtils.getInstance().apply {
                remove(Const.ROLE)
                remove(Const.TOKEN)
                remove(Const.UID)
                remove(Const.UNAME)
            }
            ArouterManager.navigation(requireContext(),"/app/LoginActivity")
        }

        binding.myUname.setText(SPUtils.getInstance().getString(Const.UNAME))

        binding.myfavIv.setOnClickListener {
            ArouterManager.navigation(requireContext(),"/app/MyApplyActivity")
        }

        binding.myapproveIv.setOnClickListener {
            ArouterManager.navigation(requireContext(),"/app/MyApproveActivity")
        }

        binding.mybillIv.setOnClickListener {
            ArouterManager.navigation(requireContext(),"/shop/OrderActivity")
        }
    }

}